<!-- <template>
	<view class="content">
		<mix-tree 
			:list="list" 
			:params="treeParams"
			@treeItemClick="treeItemClick"
		></mix-tree>
	</view>
</template>

<script>
	import mixTree from '@/components/mix-tree/mix-tree'
	import {apiApproverInfo} from '@/common/api.js'
	
	export default {
		components: {
			mixTree
		},
		data() {
			return {
				list: [],
				treeParams: {
					border: true   // 边框， 默认不显示
				}
			}
		},
		onLoad() {
			let testList
			apiApproverInfo().then(res=>{
				testList = res.data.userListCheck
				console.log(testList)
			})
			setTimeout(()=>{
				this.list = testList;
			}, 500)
		},
		methods: {
			//点击最后一级时触发该事件
			treeItemClick(item) {
				let {
					id,
					name,
					parentId
				} = item;
				uni.showModal({
					content: `点击了${parentId.length+1}级菜单, ${name}, id为${id}, 父id为${parentId.toString()}`
				})
				console.log(item)
			}
		}
	}
</script>

<style>

</style>
 -->